home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / MacTCP.p < prev    next >
Text File  |  1996-05-01  |  21KB  |  797 lines

  1. {
  2.      File:        MacTCP.p
  3.  
  4.      Contains:    TCP Manager Interfaces.
  5.  
  6.      Version:    Technology:    MacTCP 2.0.6
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT MacTCP;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __MACTCP__}
  28. {$SETC __MACTCP__ := 1}
  29.  
  30. {$I+}
  31. {$SETC MacTCPIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __APPLETALK__}
  41. {$I AppleTalk.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  49. {
  50. Developer Notes:
  51.         0. This MacTCP header replaces what used to be defined in the following header files
  52.             MacTCPCommonTypes.h
  53.             GetMyIPAddr.h
  54.             MiscIPPB.h
  55.             TCPPB.h
  56.             UDPPB.h 
  57.             
  58.             When the various control calls are made to the ip driver, you must set up a 
  59.             NewRoutineDescriptor for every non-nil completion routine and/or notifyProc parameter.  
  60.             Otherwise, the 68K driver code, will not correctly call your routine.
  61.         1. For ipctlGetAddr Control calls, use NewGetIPIOCompletionProc
  62.             to set up a GetIPIOCompletionUPP universal procptr to pass as
  63.             the ioCompletion parameter.
  64.         2. For the ipctlEchoICMP and ipctlLAPStats Control calls, use 
  65.             NewIPIOCompletion to set up a IPIOCompletionUPP universal procptr
  66.             to pass in the ioCompletion field of the parameter block.
  67.         3. For TCPCreatePB Control calls, use NewTCPNotifyProc to set up a
  68.             TCPNotifyUPP universal procptr to pass in the notifyProc field
  69.             of the parameter block
  70.         4. For all of the TCP Control calls using the TCPiopb parameter block,
  71.             use NewTCPIOCompletionProc to set up a TCPIOCompletionUPP
  72.             universal procptr to pass in the ioCompletion field of the paramter
  73.             block.
  74.         5. For UDBCreatePB Control calls, use NewUDPNotifyProc to set up a
  75.             UDPNotifyUPP universal procptr to pass in the notifyProc field
  76.             of the parameter block
  77.         6. For all of the UDP Control calls using the UDPiopb parameter block,
  78.             use NewUDPIOCompletionProc to set up a UDPIOCompletionUPP
  79.             universal procptr to pass in the ioCompletion field of the paramter
  80.             block.
  81.         7. For all calls implementing a notifyProc or ioCompletion routine
  82.             which was set up using a NewTCPRoutineProc call, do not call
  83.             DisposeRoutineSDescriptor on the universal procptr until
  84.             after the completion or notify proc has completed.
  85. }
  86. {  MacTCP return Codes in the range -23000 through -23049  }
  87.  
  88. CONST
  89.     inProgress                    = 1;                            {  I/O in progress  }
  90.     ipBadLapErr                    = -23000;                        {  bad network configuration  }
  91.     ipBadCnfgErr                = -23001;                        {  bad IP configuration error  }
  92.     ipNoCnfgErr                    = -23002;                        {  missing IP or LAP configuration error  }
  93.     ipLoadErr                    = -23003;                        {  error in MacTCP load  }
  94.     ipBadAddr                    = -23004;                        {  error in getting address  }
  95.     connectionClosing            = -23005;                        {  connection is closing  }
  96.     invalidLength                = -23006;
  97.     connectionExists            = -23007;                        {  request conflicts with existing connection  }
  98.     connectionDoesntExist        = -23008;                        {  connection does not exist  }
  99.     insufficientResources        = -23009;                        {  insufficient resources to perform request  }
  100.     invalidStreamPtr            = -23010;
  101.     streamAlreadyOpen            = -23011;
  102.     connectionTerminated        = -23012;
  103.     invalidBufPtr                = -23013;
  104.     invalidRDS                    = -23014;
  105.     invalidWDS                    = -23014;
  106.     openFailed                    = -23015;
  107.     commandTimeout                = -23016;
  108.     duplicateSocket                = -23017;
  109.  
  110. {  Error codes from internal IP functions  }
  111.     ipDontFragErr                = -23032;                        {  Packet too large to send w/o fragmenting  }
  112.     ipDestDeadErr                = -23033;                        {  destination not responding  }
  113.     icmpEchoTimeoutErr            = -23035;                        {  ICMP echo timed-out  }
  114.     ipNoFragMemErr                = -23036;                        {  no memory to send fragmented pkt  }
  115.     ipRouteErr                    = -23037;                        {  can't route packet off-net  }
  116.     nameSyntaxErr                = -23041;
  117.     cacheFault                    = -23042;
  118.     noResultProc                = -23043;
  119.     noNameServer                = -23044;
  120.     authNameErr                    = -23045;
  121.     noAnsErr                    = -23046;
  122.     dnrErr                        = -23047;
  123.     outOfMemory                    = -23048;
  124.  
  125.     BYTES_16WORD                = 2;                            {  bytes per = 16, bit ip word  }
  126.     BYTES_32WORD                = 4;                            {  bytes per = 32, bit ip word  }
  127.     BYTES_64WORD                = 8;                            {  bytes per = 64, bit ip word  }
  128.  
  129. {  8-bit quantity  }
  130.  
  131. TYPE
  132.     b_8                                    = UInt8;
  133. {  16-bit quantity  }
  134.     b_16                                = UInt16;
  135. {  32-bit quantity  }
  136.     b_32                                = UInt32;
  137. {  IP address is 32-bits  }
  138.     ip_addr                                = b_32;
  139.     ip_addrbytesPtr = ^ip_addrbytes;
  140.     ip_addrbytes = RECORD
  141.         CASE INTEGER OF
  142.         0: (
  143.             addr:                b_32;
  144.             );
  145.         1: (
  146.             byte:                PACKED ARRAY [0..3] OF UInt8;
  147.             );
  148.     END;
  149.  
  150.     wdsEntryPtr = ^wdsEntry;
  151.     wdsEntry = RECORD
  152.         length:                    INTEGER;                                {  length of buffer  }
  153.         ptr:                    Ptr;                                    {  pointer to buffer  }
  154.     END;
  155.  
  156.     rdsEntryPtr = ^rdsEntry;
  157.     rdsEntry = RECORD
  158.         length:                    INTEGER;                                {  length of buffer  }
  159.         ptr:                    Ptr;                                    {  pointer to buffer  }
  160.     END;
  161.  
  162.     BufferPtr                            = LONGINT;
  163.     StreamPtr                            = LONGINT;
  164.  
  165. CONST
  166.     netUnreach                    = 0;
  167.     hostUnreach                    = 1;
  168.     protocolUnreach                = 2;
  169.     portUnreach                    = 3;
  170.     fragReqd                    = 4;
  171.     sourceRouteFailed            = 5;
  172.     timeExceeded                = 6;
  173.     parmProblem                    = 7;
  174.     missingOption                = 8;
  175.     lastICMPMsgType                = 32767;
  176.  
  177.  
  178. TYPE
  179.     ICMPMsgType                            = INTEGER;
  180.     ip_port                                = b_16;
  181.     ICMPReportPtr = ^ICMPReport;
  182.     ICMPReport = RECORD
  183.         streamPtr:                StreamPtr;
  184.         localHost:                ip_addr;
  185.         localPort:                ip_port;
  186.         remoteHost:                ip_addr;
  187.         remotePort:                ip_port;
  188.         reportType:                INTEGER;
  189.         optionalAddlInfo:        INTEGER;
  190.         optionalAddlInfoPtr:    LONGINT;
  191.     END;
  192.  
  193. {  csCode to get our IP address  }
  194.  
  195. CONST
  196.     ipctlGetAddr                = 15;
  197.  
  198.  
  199. TYPE
  200.     GetAddrParamBlockPtr = ^GetAddrParamBlock;
  201.     GetIPIOCompletionProcPtr = ProcPtr;  { PROCEDURE GetIPIOCompletion(VAR iopb: GetAddrParamBlock); C; }
  202.  
  203.     GetIPIOCompletionUPP = UniversalProcPtr;
  204.     GetAddrParamBlock = RECORD
  205.         qLink:                    QElemPtr;
  206.         qType:                    INTEGER;
  207.         ioTrap:                    INTEGER;
  208.         ioCmdAddr:                Ptr;
  209.         ioCompletion:            GetIPIOCompletionUPP;
  210.         ioResult:                OSErr;
  211.         ioNamePtr:                StringPtr;
  212.         ioVRefNum:                INTEGER;
  213.         ioCRefNum:                INTEGER;
  214.         csCode:                    INTEGER;
  215.         ourAddress:                ip_addr;                                {  our IP address  }
  216.         ourNetMask:                LONGINT;                                {  our IP net mask  }
  217.     END;
  218.  
  219. {  control codes  }
  220.  
  221. CONST
  222.     ipctlEchoICMP                = 17;                            {  send icmp echo  }
  223.     ipctlLAPStats                = 19;                            {  get lap stats  }
  224.  
  225.  
  226. TYPE
  227.     ICMPParamBlockPtr = ^ICMPParamBlock;
  228.     IPIOCompletionProcPtr = ProcPtr;  { PROCEDURE IPIOCompletion(VAR iopb: ICMPParamBlock); C; }
  229.  
  230.     IPIOCompletionUPP = UniversalProcPtr;
  231.     ICMPParamBlock = RECORD
  232.         qLink:                    QElemPtr;
  233.         qType:                    INTEGER;
  234.         ioTrap:                    INTEGER;
  235.         ioCmdAddr:                Ptr;
  236.         ioCompletion:            IPIOCompletionUPP;
  237.         ioResult:                OSErr;
  238.         ioNamePtr:                StringPtr;
  239.         ioVRefNum:                INTEGER;
  240.         ioCRefNum:                INTEGER;
  241.         csCode:                    INTEGER;
  242.         params:                    ARRAY [0..10] OF INTEGER;
  243.         echoRequestOut:            LONGINT;                                {  time in ticks of when the echo request went out  }
  244.         echoReplyIn:            LONGINT;                                {  time in ticks of when the reply was received  }
  245.         echoedData:                rdsEntry;                                {  data received in responce  }
  246.         options:                Ptr;
  247.         userDataPtr:            LONGINT;
  248.     END;
  249.  
  250.     ICMPEchoNotifyProcPtr = ProcPtr;  { PROCEDURE ICMPEchoNotify(VAR iopb: ICMPParamBlock); C; }
  251.  
  252.     ICMPEchoNotifyUPP = UniversalProcPtr;
  253.     LAPStatsPtr = ^LAPStats;
  254.     IPParamBlockPtr = ^IPParamBlock;
  255.     IPParamBlock = RECORD
  256.         qLink:                    QElemPtr;
  257.         qType:                    INTEGER;
  258.         ioTrap:                    INTEGER;
  259.         ioCmdAddr:                Ptr;
  260.         ioCompletion:            IPIOCompletionUPP;
  261.         ioResult:                OSErr;
  262.         ioNamePtr:                StringPtr;
  263.         ioVRefNum:                INTEGER;
  264.         ioCRefNum:                INTEGER;
  265.         csCode:                    INTEGER;
  266.         CASE INTEGER OF
  267.         0: (
  268.             dest:                ip_addr;                                {  echo to IP address  }
  269.             data:                wdsEntry;
  270.             timeout:            INTEGER;
  271.             options:            Ptr;
  272.             optLength:            INTEGER;
  273.             icmpCompletion:        ICMPEchoNotifyUPP;
  274.             userDataPtr:        LONGINT;
  275.            );
  276.         1: (
  277.             lapStatsPtr:        LAPStatsPtr;
  278.            );
  279.     END;
  280.  
  281.     nbp_entryPtr = ^nbp_entry;
  282.     nbp_entry = RECORD
  283.         ip_address:                ip_addr;                                {  IP address  }
  284.         at_address:                AddrBlock;                                {  matching AppleTalk address  }
  285.         gateway:                BOOLEAN;                                {  TRUE if entry for a gateway  }
  286.         valid:                    BOOLEAN;                                {  TRUE if LAP address is valid  }
  287.         probing:                BOOLEAN;                                {  TRUE if NBP lookup pending  }
  288.         afiller:                SInt8;                                    {  Filler for proper byte alignment      }
  289.         age:                    LONGINT;                                {  ticks since cache entry verified  }
  290.         access:                    LONGINT;                                {  ticks since last access  }
  291.         filler:                    ARRAY [0..115] OF SInt8;                {  for internal use only !!!  }
  292.     END;
  293.  
  294.     Enet_addrPtr = ^Enet_addr;
  295.     Enet_addr = RECORD
  296.         en_hi:                    b_16;
  297.         en_lo:                    b_32;
  298.     END;
  299.  
  300.     arp_entryPtr = ^arp_entry;
  301.     arp_entry = RECORD
  302.         age:                    INTEGER;                                {  cache aging field  }
  303.         protocol:                b_16;                                    {  Protocol type  }
  304.         ip_address:                ip_addr;                                {  IP address  }
  305.         en_address:                Enet_addr;                                {  matching Ethernet address  }
  306.     END;
  307.  
  308.     LAPStatsAddrXlationPtr = ^LAPStatsAddrXlation;
  309.     LAPStatsAddrXlation = RECORD
  310.         CASE INTEGER OF
  311.         0: (
  312.             arp_table:            arp_entryPtr;
  313.             );
  314.         1: (
  315.             nbp_table:            nbp_entryPtr;
  316.             );
  317.     END;
  318.  
  319.     LAPStats = RECORD
  320.         ifType:                    INTEGER;
  321.         ifString:                CStringPtr;
  322.         ifMaxMTU:                INTEGER;
  323.         ifSpeed:                LONGINT;
  324.         ifPhyAddrLength:        INTEGER;
  325.         ifPhysicalAddress:        CStringPtr;
  326.         AddrXlation:            LAPStatsAddrXlation;
  327.         slotNumber:                INTEGER;
  328.     END;
  329.  
  330. {  number of ARP table entries  }
  331.  
  332. CONST
  333.     ARP_TABLE_SIZE                = 20;
  334.  
  335.     NBP_TABLE_SIZE                = 20;                            {  number of NBP table entries  }
  336.     NBP_MAX_NAME_SIZE            = 28;
  337.  
  338. {  Command codes  }
  339.     TCPCreate                    = 30;
  340.     TCPPassiveOpen                = 31;
  341.     TCPActiveOpen                = 32;
  342.     TCPSend                        = 34;
  343.     TCPNoCopyRcv                = 35;
  344.     TCPRcvBfrReturn                = 36;
  345.     TCPRcv                        = 37;
  346.     TCPClose                    = 38;
  347.     TCPAbort                    = 39;
  348.     TCPStatus                    = 40;
  349.     TCPExtendedStat                = 41;
  350.     TCPRelease                    = 42;
  351.     TCPGlobalInfo                = 43;
  352.     TCPCtlMax                    = 49;
  353.  
  354.     TCPClosing                    = 1;
  355.     TCPULPTimeout                = 2;
  356.     TCPTerminate                = 3;
  357.     TCPDataArrival                = 4;
  358.     TCPUrgent                    = 5;
  359.     TCPICMPReceived                = 6;
  360.     lastEvent                    = 32767;
  361.  
  362.  
  363. TYPE
  364.     TCPEventCode                        = INTEGER;
  365.  
  366. CONST
  367.     TCPRemoteAbort                = 2;
  368.     TCPNetworkFailure            = 3;
  369.     TCPSecPrecMismatch            = 4;
  370.     TCPULPTimeoutTerminate        = 5;
  371.     TCPULPAbort                    = 6;
  372.     TCPULPClose                    = 7;
  373.     TCPServiceError                = 8;
  374.     lastReason                    = 32767;
  375.  
  376.  
  377. TYPE
  378.     TCPTerminationReason                = INTEGER;
  379.     TCPNotifyProcPtr = ProcPtr;  { PROCEDURE TCPNotify(tcpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Ptr; terminReason: INTEGER; VAR icmpMsg: ICMPReport); }
  380.  
  381.     TCPNotifyUPP = UniversalProcPtr;
  382.     tcp_port                            = INTEGER;
  383. {  ValidityFlags  }
  384.  
  385. CONST
  386.     timeoutValue                = $80;
  387.     timeoutAction                = $40;
  388.     typeOfService                = $20;
  389.     precedence                    = $10;
  390.  
  391. {  TOSFlags  }
  392.     lowDelay                    = $01;
  393.     throughPut                    = $02;
  394.     reliability                    = $04;
  395.  
  396.  
  397. TYPE
  398.     TCPCreatePBPtr = ^TCPCreatePB;
  399.     TCPCreatePB = RECORD
  400.         rcvBuff:                Ptr;
  401.         rcvBuffLen:                LONGINT;
  402.         notifyProc:                TCPNotifyUPP;
  403.         userDataPtr:            Ptr;
  404.     END;
  405.  
  406.     TCPOpenPBPtr = ^TCPOpenPB;
  407.     TCPOpenPB = RECORD
  408.         ulpTimeoutValue:        SInt8;
  409.         ulpTimeoutAction:        SInt8;
  410.         validityFlags:            SInt8;
  411.         commandTimeoutValue:    SInt8;
  412.         remoteHost:                ip_addr;
  413.         remotePort:                tcp_port;
  414.         localHost:                ip_addr;
  415.         localPort:                tcp_port;
  416.         tosFlags:                SInt8;
  417.         precedence:                SInt8;
  418.         dontFrag:                BOOLEAN;
  419.         timeToLive:                SInt8;
  420.         security:                SInt8;
  421.         optionCnt:                SInt8;
  422.         options:                ARRAY [0..39] OF SInt8;
  423.         userDataPtr:            Ptr;
  424.     END;
  425.  
  426.     TCPSendPBPtr = ^TCPSendPB;
  427.     TCPSendPB = RECORD
  428.         ulpTimeoutValue:        SInt8;
  429.         ulpTimeoutAction:        SInt8;
  430.         validityFlags:            SInt8;
  431.         pushFlag:                BOOLEAN;
  432.         urgentFlag:                BOOLEAN;
  433.         filler:                    SInt8;                                    {  Filler for proper byte alignment      }
  434.         wdsPtr:                    Ptr;
  435.         sendFree:                LONGINT;
  436.         sendLength:                INTEGER;
  437.         userDataPtr:            Ptr;
  438.     END;
  439.  
  440. {  for receive and return rcv buff calls  }
  441. {    Note: the filler in the following structure is in a different location than  }
  442. {          that specified in the Programmer's Guide.   }
  443.     TCPReceivePBPtr = ^TCPReceivePB;
  444.     TCPReceivePB = RECORD
  445.         commandTimeoutValue:    SInt8;
  446.         markFlag:                BOOLEAN;
  447.         urgentFlag:                BOOLEAN;
  448.         filler:                    SInt8;                                    {  Filler for proper byte alignment   }
  449.         rcvBuff:                Ptr;
  450.         rcvBuffLen:                INTEGER;
  451.         rdsPtr:                    Ptr;
  452.         rdsLength:                INTEGER;
  453.         secondTimeStamp:        INTEGER;
  454.         userDataPtr:            Ptr;
  455.     END;
  456.  
  457.     TCPClosePBPtr = ^TCPClosePB;
  458.     TCPClosePB = RECORD
  459.         ulpTimeoutValue:        SInt8;
  460.         ulpTimeoutAction:        SInt8;
  461.         validityFlags:            SInt8;
  462.         filler:                    SInt8;                                    {  Filler for proper byte alignment      }
  463.         userDataPtr:            Ptr;
  464.     END;
  465.  
  466.     HistoBucketPtr = ^HistoBucket;
  467.     HistoBucket = RECORD
  468.         value:                    INTEGER;
  469.         counter:                LONGINT;
  470.     END;
  471.  
  472.  
  473. CONST
  474.     NumOfHistoBuckets            = 7;
  475.  
  476.  
  477. TYPE
  478.     TCPConnectionStatsPtr = ^TCPConnectionStats;
  479.     TCPConnectionStats = RECORD
  480.         dataPktsRcvd:            LONGINT;
  481.         dataPktsSent:            LONGINT;
  482.         dataPktsResent:            LONGINT;
  483.         bytesRcvd:                LONGINT;
  484.         bytesRcvdDup:            LONGINT;
  485.         bytesRcvdPastWindow:    LONGINT;
  486.         bytesSent:                LONGINT;
  487.         bytesResent:            LONGINT;
  488.         numHistoBuckets:        INTEGER;
  489.         sentSizeHisto:            ARRAY [0..6] OF HistoBucket;
  490.         lastRTT:                INTEGER;
  491.         tmrSRTT:                INTEGER;
  492.         rttVariance:            INTEGER;
  493.         tmrRTO:                    INTEGER;
  494.         sendTries:                SInt8;
  495.         sourchQuenchRcvd:        SInt8;
  496.     END;
  497.  
  498.     TCPStatusPBPtr = ^TCPStatusPB;
  499.     TCPStatusPB = RECORD
  500.         ulpTimeoutValue:        SInt8;
  501.         ulpTimeoutAction:        SInt8;
  502.         unused:                    LONGINT;
  503.         remoteHost:                ip_addr;
  504.         remotePort:                tcp_port;
  505.         localHost:                ip_addr;
  506.         localPort:                tcp_port;
  507.         tosFlags:                SInt8;
  508.         precedence:                SInt8;
  509.         connectionState:        SInt8;
  510.         filler:                    SInt8;                                    {  Filler for proper byte alignment      }
  511.         sendWindow:                INTEGER;
  512.         rcvWindow:                INTEGER;
  513.         amtUnackedData:            INTEGER;
  514.         amtUnreadData:            INTEGER;
  515.         securityLevelPtr:        Ptr;
  516.         sendUnacked:            LONGINT;
  517.         sendNext:                LONGINT;
  518.         congestionWindow:        LONGINT;
  519.         rcvNext:                LONGINT;
  520.         srtt:                    LONGINT;
  521.         lastRTT:                LONGINT;
  522.         sendMaxSegSize:            LONGINT;
  523.         connStatPtr:            TCPConnectionStatsPtr;
  524.         userDataPtr:            Ptr;
  525.     END;
  526.  
  527.     TCPAbortPBPtr = ^TCPAbortPB;
  528.     TCPAbortPB = RECORD
  529.         userDataPtr:            Ptr;
  530.     END;
  531.  
  532.     TCPParamPtr = ^TCPParam;
  533.     TCPParam = RECORD
  534.         tcpRtoA:                LONGINT;
  535.         tcpRtoMin:                LONGINT;
  536.         tcpRtoMax:                LONGINT;
  537.         tcpMaxSegSize:            LONGINT;
  538.         tcpMaxConn:                LONGINT;
  539.         tcpMaxWindow:            LONGINT;
  540.     END;
  541.  
  542.     TCPStatsPtr = ^TCPStats;
  543.     TCPStats = RECORD
  544.         tcpConnAttempts:        LONGINT;
  545.         tcpConnOpened:            LONGINT;
  546.         tcpConnAccepted:        LONGINT;
  547.         tcpConnClosed:            LONGINT;
  548.         tcpConnAborted:            LONGINT;
  549.         tcpOctetsIn:            LONGINT;
  550.         tcpOctetsOut:            LONGINT;
  551.         tcpOctetsInDup:            LONGINT;
  552.         tcpOctetsRetrans:        LONGINT;
  553.         tcpInputPkts:            LONGINT;
  554.         tcpOutputPkts:            LONGINT;
  555.         tcpDupPkts:                LONGINT;
  556.         tcpRetransPkts:            LONGINT;
  557.     END;
  558.  
  559.     StreamPPtr                            = ^StreamPtr;
  560.     TCPGlobalInfoPBPtr = ^TCPGlobalInfoPB;
  561.     TCPGlobalInfoPB = RECORD
  562.         tcpParamPtr:            TCPParamPtr;
  563.         tcpStatsPtr:            TCPStatsPtr;
  564.         tcpCDBTable:            ARRAY [0..0] OF StreamPPtr;
  565.         userDataPtr:            Ptr;
  566.         maxTCPConnections:        INTEGER;
  567.     END;
  568.  
  569.     TCPiopbPtr = ^TCPiopb;
  570.     TCPIOCompletionProcPtr = ProcPtr;  { PROCEDURE TCPIOCompletion(VAR iopb: TCPiopb); C; }
  571.  
  572.     TCPIOCompletionUPP = UniversalProcPtr;
  573.     TCPiopb = RECORD
  574.         fill12:                    ARRAY [0..11] OF SInt8;
  575.         ioCompletion:            TCPIOCompletionUPP;
  576.         ioResult:                INTEGER;
  577.         ioNamePtr:                Ptr;
  578.         ioVRefNum:                INTEGER;
  579.         ioCRefNum:                INTEGER;
  580.         csCode:                    INTEGER;
  581.         tcpStream:                StreamPtr;
  582.         CASE INTEGER OF
  583.         0: (
  584.             create:                TCPCreatePB;
  585.             );
  586.         1: (
  587.             open:                TCPOpenPB;
  588.             );
  589.         2: (
  590.             send:                TCPSendPB;
  591.             );
  592.         3: (
  593.             receive:            TCPReceivePB;
  594.             );
  595.         4: (
  596.             close:                TCPClosePB;
  597.             );
  598.         5: (
  599.             abort:                TCPAbortPB;
  600.             );
  601.         6: (
  602.             status:                TCPStatusPB;
  603.             );
  604.         7: (
  605.             globalInfo:            TCPGlobalInfoPB;
  606.             );
  607.     END;
  608.  
  609.  
  610. CONST
  611.     UDPCreate                    = 20;
  612.     UDPRead                        = 21;
  613.     UDPBfrReturn                = 22;
  614.     UDPWrite                    = 23;
  615.     UDPRelease                    = 24;
  616.     UDPMaxMTUSize                = 25;
  617.     UDPStatus                    = 26;
  618.     UDPMultiCreate                = 27;
  619.     UDPMultiSend                = 28;
  620.     UDPMultiRead                = 29;
  621.     UDPCtlMax                    = 29;
  622.  
  623.     UDPDataArrival                = 1;
  624.     UDPICMPReceived                = 2;
  625.     lastUDPEvent                = 32767;
  626.  
  627.  
  628. TYPE
  629.     UDPEventCode                        = INTEGER;
  630.     UDPNotifyProcPtr = ProcPtr;  { PROCEDURE UDPNotify(udpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Ptr; VAR icmpMsg: ICMPReport); }
  631.  
  632.     UDPNotifyUPP = UniversalProcPtr;
  633.     udp_port                            = INTEGER;
  634. {  for create and release calls  }
  635.     UDPCreatePBPtr = ^UDPCreatePB;
  636.     UDPCreatePB = RECORD
  637.         rcvBuff:                Ptr;
  638.         rcvBuffLen:                LONGINT;
  639.         notifyProc:                UDPNotifyUPP;
  640.         localPort:                INTEGER;
  641.         userDataPtr:            Ptr;
  642.         endingPort:                udp_port;
  643.     END;
  644.  
  645.     UDPSendPBPtr = ^UDPSendPB;
  646.     UDPSendPB = RECORD
  647.         reserved:                INTEGER;
  648.         remoteHost:                ip_addr;
  649.         remotePort:                udp_port;
  650.         wdsPtr:                    Ptr;
  651.         checkSum:                BOOLEAN;
  652.         filler:                    SInt8;                                    {  Filler for proper byte alignment      }
  653.         sendLength:                INTEGER;
  654.         userDataPtr:            Ptr;
  655.         localPort:                udp_port;
  656.     END;
  657.  
  658. {  for receive and buffer return calls  }
  659.     UDPReceivePBPtr = ^UDPReceivePB;
  660.     UDPReceivePB = RECORD
  661.         timeOut:                INTEGER;
  662.         remoteHost:                ip_addr;
  663.         remotePort:                udp_port;
  664.         rcvBuff:                Ptr;
  665.         rcvBuffLen:                INTEGER;
  666.         secondTimeStamp:        INTEGER;
  667.         userDataPtr:            Ptr;
  668.         destHost:                ip_addr;                                {  only for use with multi rcv  }
  669.         destPort:                udp_port;                                {  only for use with multi rcv  }
  670.     END;
  671.  
  672.     UDPMTUPBPtr = ^UDPMTUPB;
  673.     UDPMTUPB = RECORD
  674.         mtuSize:                INTEGER;
  675.         remoteHost:                ip_addr;
  676.         userDataPtr:            Ptr;
  677.     END;
  678.  
  679.     UDPiopbPtr = ^UDPiopb;
  680.     UDPIOCompletionProcPtr = ProcPtr;  { PROCEDURE UDPIOCompletion(VAR iopb: UDPiopb); C; }
  681.  
  682.     UDPIOCompletionUPP = UniversalProcPtr;
  683.     UDPiopb = RECORD
  684.         fill12:                    ARRAY [0..11] OF SInt8;
  685.         ioCompletion:            UDPIOCompletionUPP;
  686.         ioResult:                INTEGER;
  687.         ioNamePtr:                Ptr;
  688.         ioVRefNum:                INTEGER;
  689.         ioCRefNum:                INTEGER;
  690.         csCode:                    INTEGER;
  691.         udpStream:                StreamPtr;
  692.         CASE INTEGER OF
  693.         0: (
  694.             create:                UDPCreatePB;
  695.             );
  696.         1: (
  697.             send:                UDPSendPB;
  698.             );
  699.         2: (
  700.             receive:            UDPReceivePB;
  701.             );
  702.         3: (
  703.             mtu:                UDPMTUPB;
  704.             );
  705.     END;
  706.  
  707.  
  708. CONST
  709.     uppGetIPIOCompletionProcInfo = $000000C1;
  710.     uppIPIOCompletionProcInfo = $000000C1;
  711.     uppICMPEchoNotifyProcInfo = $000000C1;
  712.     uppTCPNotifyProcInfo = $0000EEC0;
  713.     uppTCPIOCompletionProcInfo = $000000C1;
  714.     uppUDPNotifyProcInfo = $00003EC0;
  715.     uppUDPIOCompletionProcInfo = $000000C1;
  716.  
  717. FUNCTION NewGetIPIOCompletionProc(userRoutine: GetIPIOCompletionProcPtr): GetIPIOCompletionUPP;
  718.     {$IFC NOT GENERATINGCFM }
  719.     INLINE $2E9F;
  720.     {$ENDC}
  721.  
  722. FUNCTION NewIPIOCompletionProc(userRoutine: IPIOCompletionProcPtr): IPIOCompletionUPP;
  723.     {$IFC NOT GENERATINGCFM }
  724.     INLINE $2E9F;
  725.     {$ENDC}
  726.  
  727. FUNCTION NewICMPEchoNotifyProc(userRoutine: ICMPEchoNotifyProcPtr): ICMPEchoNotifyUPP;
  728.     {$IFC NOT GENERATINGCFM }
  729.     INLINE $2E9F;
  730.     {$ENDC}
  731.  
  732. FUNCTION NewTCPNotifyProc(userRoutine: TCPNotifyProcPtr): TCPNotifyUPP;
  733.     {$IFC NOT GENERATINGCFM }
  734.     INLINE $2E9F;
  735.     {$ENDC}
  736.  
  737. FUNCTION NewTCPIOCompletionProc(userRoutine: TCPIOCompletionProcPtr): TCPIOCompletionUPP;
  738.     {$IFC NOT GENERATINGCFM }
  739.     INLINE $2E9F;
  740.     {$ENDC}
  741.  
  742. FUNCTION NewUDPNotifyProc(userRoutine: UDPNotifyProcPtr): UDPNotifyUPP;
  743.     {$IFC NOT GENERATINGCFM }
  744.     INLINE $2E9F;
  745.     {$ENDC}
  746.  
  747. FUNCTION NewUDPIOCompletionProc(userRoutine: UDPIOCompletionProcPtr): UDPIOCompletionUPP;
  748.     {$IFC NOT GENERATINGCFM }
  749.     INLINE $2E9F;
  750.     {$ENDC}
  751.  
  752. PROCEDURE CallGetIPIOCompletionProc(VAR iopb: GetAddrParamBlock; userRoutine: GetIPIOCompletionUPP);
  753.     {$IFC NOT GENERATINGCFM}
  754.     {To be implemented:  Glue to move parameters into registers.}
  755.     {$ENDC}
  756.  
  757. PROCEDURE CallIPIOCompletionProc(VAR iopb: ICMPParamBlock; userRoutine: IPIOCompletionUPP);
  758.     {$IFC NOT GENERATINGCFM}
  759.     {To be implemented:  Glue to move parameters into registers.}
  760.     {$ENDC}
  761.  
  762. PROCEDURE CallICMPEchoNotifyProc(VAR iopb: ICMPParamBlock; userRoutine: ICMPEchoNotifyUPP);
  763.     {$IFC NOT GENERATINGCFM}
  764.     {To be implemented:  Glue to move parameters into registers.}
  765.     {$ENDC}
  766.  
  767. PROCEDURE CallTCPNotifyProc(tcpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Ptr; terminReason: INTEGER; VAR icmpMsg: ICMPReport; userRoutine: TCPNotifyUPP);
  768.     {$IFC NOT GENERATINGCFM}
  769.     INLINE $205F, $4E90;
  770.     {$ENDC}
  771.  
  772. PROCEDURE CallTCPIOCompletionProc(VAR iopb: TCPiopb; userRoutine: TCPIOCompletionUPP);
  773.     {$IFC NOT GENERATINGCFM}
  774.     {To be implemented:  Glue to move parameters into registers.}
  775.     {$ENDC}
  776.  
  777. PROCEDURE CallUDPNotifyProc(udpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Ptr; VAR icmpMsg: ICMPReport; userRoutine: UDPNotifyUPP);
  778.     {$IFC NOT GENERATINGCFM}
  779.     INLINE $205F, $4E90;
  780.     {$ENDC}
  781.  
  782. PROCEDURE CallUDPIOCompletionProc(VAR iopb: UDPiopb; userRoutine: UDPIOCompletionUPP);
  783.     {$IFC NOT GENERATINGCFM}
  784.     {To be implemented:  Glue to move parameters into registers.}
  785.     {$ENDC}
  786. {$ENDC}
  787. {$ALIGN RESET}
  788. {$POP}
  789.  
  790. {$SETC UsingIncludes := MacTCPIncludes}
  791.  
  792. {$ENDC} {__MACTCP__}
  793.  
  794. {$IFC NOT UsingIncludes}
  795.  END.
  796. {$ENDC}
  797.